<?php
namespace App\Controller;

use Think\Log;
use Think\Upload;

class IosController extends BaseController
{

	/**
	 * 上传图片接口
	 */
	public function up_img()
	{
		$info=upload('images');
		if(!is_array($info)){
			$this->error(401, $info);
		}
		$img=array();
		foreach($info as $key =>$val){
			$img[]= C('UPLOADPATH').$val['savepath'].$val['savename'];
		}
		$data['img']=implode(',', $img);
		$this->success('上传成功',array('images'=>$img));
	}


	public function base64_img(){
		$imgs = I('images');
		if(empty($img)){
			$this->error(401,"图片不能为空");
		}
		$img=uploadBase64file($imgs,'images/');
		$data['img']=implode(',', $img);
		$this->success('上传成功',array('images'=>$img));
	}
}